﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract KlijentNapomena typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class KlijentNapomenaDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<KlijentNapomenaDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.KlijentNapomena _currentKlijentNapomena = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxKlijentNapomenaDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxKlijentNapomenaErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxKlijentNapomenaBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDKlijent property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDKlijentDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DateCreated property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDateCreatedDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DateModified property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDateModifiedDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Napomena property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNapomenaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDUserCreated property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDUserCreatedDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDUserModified property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDUserModifiedDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Djelatnik> _IDUserCreatedList;
		
		/// <summary> 
		/// The list of selectable Djelatnik
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Djelatnik> IDUserCreatedList
		{
			get {return this._IDUserCreatedList;}
			set 
			{
				this._IDUserCreatedList = value;
				this.uxIDUserCreatedDataGridViewColumn.DataSource = null;
				this.uxIDUserCreatedDataGridViewColumn.DataSource = this._IDUserCreatedList;
			}
		}
		
		private bool _allowNewItemInIDUserCreatedList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Djelatnik
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDUserCreatedList
		{
			get { return _allowNewItemInIDUserCreatedList;}
			set
			{
				this._allowNewItemInIDUserCreatedList = value;
				this.uxIDUserCreatedDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.Djelatnik> _IDUserModifiedList;
		
		/// <summary> 
		/// The list of selectable Djelatnik
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Djelatnik> IDUserModifiedList
		{
			get {return this._IDUserModifiedList;}
			set 
			{
				this._IDUserModifiedList = value;
				this.uxIDUserModifiedDataGridViewColumn.DataSource = null;
				this.uxIDUserModifiedDataGridViewColumn.DataSource = this._IDUserModifiedList;
			}
		}
		
		private bool _allowNewItemInIDUserModifiedList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Djelatnik
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDUserModifiedList
		{
			get { return _allowNewItemInIDUserModifiedList;}
			set
			{
				this._allowNewItemInIDUserModifiedList = value;
				this.uxIDUserModifiedDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.Klijent> _IDKlijentList;
		
		/// <summary> 
		/// The list of selectable Klijent
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Klijent> IDKlijentList
		{
			get {return this._IDKlijentList;}
			set 
			{
				this._IDKlijentList = value;
				this.uxIDKlijentDataGridViewColumn.DataSource = null;
				this.uxIDKlijentDataGridViewColumn.DataSource = this._IDKlijentList;
			}
		}
		
		private bool _allowNewItemInIDKlijentList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Klijent
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKlijentList
		{
			get { return _allowNewItemInIDKlijentList;}
			set
			{
				this._allowNewItemInIDKlijentList = value;
				this.uxIDKlijentDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.KlijentNapomena> _KlijentNapomenaList;
				
		/// <summary> 
		/// The list of KlijentNapomena to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.KlijentNapomena> KlijentNapomenaList
		{
			get {return this._KlijentNapomenaList;}
			set
			{
				this._KlijentNapomenaList = value;
				this.uxKlijentNapomenaBindingSource.DataSource = null;
				this.uxKlijentNapomenaBindingSource.DataSource = value;
				this.uxKlijentNapomenaDataGridView.DataSource = null;
				this.uxKlijentNapomenaDataGridView.DataSource = this.uxKlijentNapomenaBindingSource;				
				//this.uxKlijentNapomenaBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxKlijentNapomenaBindingSource_ListChanged);
				this.uxKlijentNapomenaBindingSource.CurrentItemChanged += new System.EventHandler(OnKlijentNapomenaBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnKlijentNapomenaBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentKlijentNapomena = uxKlijentNapomenaBindingSource.Current as Entities.KlijentNapomena;
			
			if (_currentKlijentNapomena != null)
			{
				_currentKlijentNapomena.Validate();
			}
			//_KlijentNapomena.Validate();
			OnCurrentEntityChanged();
		}

		//void uxKlijentNapomenaBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.KlijentNapomena"/> instance.
		/// </summary>
		public Entities.KlijentNapomena SelectedKlijentNapomena
		{
			get {return this._currentKlijentNapomena;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxKlijentNapomenaDataGridView.VirtualMode;}
			set
			{
				this.uxKlijentNapomenaDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxKlijentNapomenaDataGridView.AllowUserToAddRows;}
			set {this.uxKlijentNapomenaDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxKlijentNapomenaDataGridView.AllowUserToDeleteRows;}
			set {this.uxKlijentNapomenaDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxKlijentNapomenaDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxKlijentNapomenaDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="KlijentNapomenaDataGridViewBase"/> class.
		/// </summary>
		public KlijentNapomenaDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxKlijentNapomenaDataGridView = new System.Windows.Forms.DataGridView();
			this.uxKlijentNapomenaBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxKlijentNapomenaErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDKlijentDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDateCreatedDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDateModifiedDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNapomenaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDUserCreatedDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDUserModifiedDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			//this.uxIDUserCreatedBindingSource = new DjelatnikBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDUserCreatedBindingSource)).BeginInit();
			//this.uxIDUserModifiedBindingSource = new DjelatnikBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDUserModifiedBindingSource)).BeginInit();
			//this.uxIDKlijentBindingSource = new KlijentBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKlijentBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKlijentNapomenaDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKlijentNapomenaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKlijentNapomenaErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxKlijentNapomenaErrorProvider
			// 
			this.uxKlijentNapomenaErrorProvider.ContainerControl = this;
			this.uxKlijentNapomenaErrorProvider.DataSource = this.uxKlijentNapomenaBindingSource;						
			// 
			// uxKlijentNapomenaDataGridView
			// 
			this.uxKlijentNapomenaDataGridView.AutoGenerateColumns = false;
			this.uxKlijentNapomenaDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxKlijentNapomenaDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDKlijentDataGridViewColumn,
		this.uxDateCreatedDataGridViewColumn,
		this.uxDateModifiedDataGridViewColumn,
		this.uxNapomenaDataGridViewColumn,
		this.uxIDUserCreatedDataGridViewColumn,
		this.uxIDUserModifiedDataGridViewColumn			});
			this.uxKlijentNapomenaDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxKlijentNapomenaDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxKlijentNapomenaDataGridView.Name = "uxKlijentNapomenaDataGridView";
			this.uxKlijentNapomenaDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxKlijentNapomenaDataGridView.TabIndex = 0;	
			this.uxKlijentNapomenaDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxKlijentNapomenaDataGridView.EnableHeadersVisualStyles = false;
			this.uxKlijentNapomenaDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnKlijentNapomenaDataGridViewDataError);
			this.uxKlijentNapomenaDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnKlijentNapomenaDataGridViewCellValueNeeded);
			this.uxKlijentNapomenaDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnKlijentNapomenaDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDKlijentDataGridViewColumn
			//
			this.uxIDKlijentDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDKlijentDataGridViewColumn.DataPropertyName = "IDKlijent";
			this.uxIDKlijentDataGridViewColumn.HeaderText = "IDKlijent";
			this.uxIDKlijentDataGridViewColumn.Name = "uxIDKlijentDataGridViewColumn";
			this.uxIDKlijentDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDKlijentDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDKlijentDataGridViewColumn.ReadOnly = false;		
			//
			// uxDateCreatedDataGridViewColumn
			//
			this.uxDateCreatedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDateCreatedDataGridViewColumn.DataPropertyName = "DateCreated";
			this.uxDateCreatedDataGridViewColumn.HeaderText = "DateCreated";
			this.uxDateCreatedDataGridViewColumn.Name = "uxDateCreatedDataGridViewColumn";
			this.uxDateCreatedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDateCreatedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDateCreatedDataGridViewColumn.ReadOnly = false;		
			//
			// uxDateModifiedDataGridViewColumn
			//
			this.uxDateModifiedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDateModifiedDataGridViewColumn.DataPropertyName = "DateModified";
			this.uxDateModifiedDataGridViewColumn.HeaderText = "DateModified";
			this.uxDateModifiedDataGridViewColumn.Name = "uxDateModifiedDataGridViewColumn";
			this.uxDateModifiedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDateModifiedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDateModifiedDataGridViewColumn.ReadOnly = false;		
			//
			// uxNapomenaDataGridViewColumn
			//
			this.uxNapomenaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNapomenaDataGridViewColumn.DataPropertyName = "Napomena";
			this.uxNapomenaDataGridViewColumn.HeaderText = "Napomena";
			this.uxNapomenaDataGridViewColumn.Name = "uxNapomenaDataGridViewColumn";
			this.uxNapomenaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNapomenaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNapomenaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDUserCreatedDataGridViewColumn
			//
			this.uxIDUserCreatedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDUserCreatedDataGridViewColumn.DataPropertyName = "IDUserCreated";
			this.uxIDUserCreatedDataGridViewColumn.HeaderText = "IDUserCreated";
			this.uxIDUserCreatedDataGridViewColumn.Name = "uxIDUserCreatedDataGridViewColumn";
			this.uxIDUserCreatedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDUserCreatedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDUserCreatedDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDUserModifiedDataGridViewColumn
			//
			this.uxIDUserModifiedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDUserModifiedDataGridViewColumn.DataPropertyName = "IDUserModified";
			this.uxIDUserModifiedDataGridViewColumn.HeaderText = "IDUserModified";
			this.uxIDUserModifiedDataGridViewColumn.Name = "uxIDUserModifiedDataGridViewColumn";
			this.uxIDUserModifiedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDUserModifiedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDUserModifiedDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDUserCreatedDataGridViewColumn
			//				
			this.uxIDUserCreatedDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDUserCreatedDataGridViewColumn.ValueMember = "ID";	
			this.uxIDUserCreatedDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDUserCreatedDataGridViewColumn.DataSource = uxIDUserCreatedBindingSource;				
				
			//
			// uxIDUserModifiedDataGridViewColumn
			//				
			this.uxIDUserModifiedDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDUserModifiedDataGridViewColumn.ValueMember = "ID";	
			this.uxIDUserModifiedDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDUserModifiedDataGridViewColumn.DataSource = uxIDUserModifiedBindingSource;				
				
			//
			// uxIDKlijentDataGridViewColumn
			//				
			this.uxIDKlijentDataGridViewColumn.DisplayMember = "ImeKlijenta";	
			this.uxIDKlijentDataGridViewColumn.ValueMember = "ID";	
			this.uxIDKlijentDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDKlijentDataGridViewColumn.DataSource = uxIDKlijentBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxKlijentNapomenaDataGridView);
			this.Name = "KlijentNapomenaDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDUserCreatedBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDUserModifiedBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDKlijentBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKlijentNapomenaErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKlijentNapomenaDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxKlijentNapomenaBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				KlijentNapomenaDataGridViewEventArgs args = new KlijentNapomenaDataGridViewEventArgs();
				args.KlijentNapomena = _currentKlijentNapomena;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class KlijentNapomenaDataGridViewEventArgs : System.EventArgs
		{
			private Entities.KlijentNapomena	_KlijentNapomena;
	
			/// <summary>
			/// the  Entities.KlijentNapomena instance.
			/// </summary>
			public Entities.KlijentNapomena KlijentNapomena
			{
				get { return _KlijentNapomena; }
				set { _KlijentNapomena = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxKlijentNapomenaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnKlijentNapomenaDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxKlijentNapomenaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnKlijentNapomenaDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxKlijentNapomenaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = KlijentNapomenaList[e.RowIndex].ID;
						break;
					case "uxIDKlijentDataGridViewColumn":
						e.Value = KlijentNapomenaList[e.RowIndex].IDKlijent;
						break;
					case "uxDateCreatedDataGridViewColumn":
						e.Value = KlijentNapomenaList[e.RowIndex].DateCreated;
						break;
					case "uxDateModifiedDataGridViewColumn":
						e.Value = KlijentNapomenaList[e.RowIndex].DateModified;
						break;
					case "uxNapomenaDataGridViewColumn":
						e.Value = KlijentNapomenaList[e.RowIndex].Napomena;
						break;
					case "uxIDUserCreatedDataGridViewColumn":
						e.Value = KlijentNapomenaList[e.RowIndex].IDUserCreated;
						break;
					case "uxIDUserModifiedDataGridViewColumn":
						e.Value = KlijentNapomenaList[e.RowIndex].IDUserModified;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxKlijentNapomenaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnKlijentNapomenaDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxKlijentNapomenaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						KlijentNapomenaList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDKlijentDataGridViewColumn":
						KlijentNapomenaList[e.RowIndex].IDKlijent = (System.Int32)e.Value;
						break;
					case "uxDateCreatedDataGridViewColumn":
						KlijentNapomenaList[e.RowIndex].DateCreated = (System.DateTime)e.Value;
						break;
					case "uxDateModifiedDataGridViewColumn":
						KlijentNapomenaList[e.RowIndex].DateModified = (System.DateTime?)e.Value;
						break;
					case "uxNapomenaDataGridViewColumn":
						KlijentNapomenaList[e.RowIndex].Napomena = (System.String)e.Value;
						break;
					case "uxIDUserCreatedDataGridViewColumn":
						KlijentNapomenaList[e.RowIndex].IDUserCreated = (System.Int32?)e.Value;
						break;
					case "uxIDUserModifiedDataGridViewColumn":
						KlijentNapomenaList[e.RowIndex].IDUserModified = (System.Int32?)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
